Neural encoding, the process by which the brain converts sensory stimuli into patterns of electrical activity within neurons, is critical for sensation to guide action. Despite this importance, little is known about how neural codes are actually used ? or ?decoded? ? by downstream networks in the brain. This gap is due to two basic challenges: (1) causally perturbing the code with spatiotemporal precision, and (2) measuring the resulting activity from identified postsynaptic target neurons. Here, we propose to overcome these challenges, by investigating how an olfactory neural code is decoded by its downstream network in a tractable experimental system: the fruit fly, Drosophila. We have developed new methods to ?write? spike patterns into populations of central projection neurons with single cell-type resolution using 2-photon optogenetics, while recording from their postsynaptic target neurons, which we have recently identified. This enables direct causal control of precise spiking features of the olfactory neural population code. In Aim 1, we will control combinatorial patterns of spike rates and relative spike latencies in projection neurons with 2-photon optogenetics to determine how these patterns are decoded by downstream neurons. In Aim 2, we will combine 2-photon optogenetic stimulation with olfactory stimulation to examine how sensory adaptation changes the logic of decoding. In Aim 3, we will test how the downstream neurons are themselves flexibly decoded into hunger-dependent chemotaxis behavior. Together, these studies will reveal basic mechanisms by which the brain decodes its own neural code for olfaction. Although there are differences between flies and mammals, the basic logic of neural coding is remarkably conserved between invertebrates and vertebrates. These similarities suggest that discoveries made in the fruit fly will be relevant to the mechanisms of decoding in other animals. A more thorough understanding of the principles of neural decoding within the brain has the potential to transform the development of novel brain- machine interfaces that could improve the outcomes of patients with brain injuries.